﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.IO;

namespace TeacherLeftHand.Util
{
    class SQLHelper
    {
        #region Constants

        public const string ConnectionKey = "Connection";
        public const string SP_ContainsKI = "Contains_KI";
        public const string SP_ContainsTM = "Contains_TM";
        public const string SP_DeleteKI = "Delete_KI";
        public const string SP_DeleteTM = "Delete_TM";
        public const string SP_DeleteTMPreferSubByTmId = "Delete_TMPreferSubByTmId";
        public const string SP_GetAllKI = "GetAll_KI";
        public const string SP_GetAllTM = "GetAll_TM";
        public const string SP_GetSubjectByClass = "GetSubjectByClass";
        public const string SP_GetSubjectByTMId = "GetSubjectByTMId";
        public const string SP_GetSubjectIDByNameAndClass = "GetIDSubjectByNameAndClass";
        public const string SP_GetSubjectList = "GetSubjectList";
        public const string SP_GetTopicByClassAndSubject = "GetTopicByClassAndSubject";
        public const string SP_GetTopicList = "GetTopicList";
        public const string SP_InsertKI = "Insert_KI";
        public const string SP_InsertTM = "Insert_TM";
        public const string SP_InsertTMPrefersSub = "Insert_TMPrefersSub";
        public const string SP_UpdateKI = "Update_KI";
        public const string SP_UpdateTM = "Update_TM";
        public const string SP_GetMaxTopicNo = "GetMaxTopicNo";
        public const string SP_AdvanceSearch_KI = "AdvanceSearch_KI";
        public const string SP_AdvanceSearch_TM = "AdvanceSearch_TM";
        public const string SP_Search_KI = "Search_KI";
        public const string SP_Search_TM = "Search_TM";

        #endregion

        /// <summary>
        /// get connection
        /// </summary>
        /// <param name="dbName">key name of the database in app.config</param>
        /// <returns></returns>
        public static string GetConnectionString()
        {
            return ConfigurationManager.AppSettings.Get(ConnectionKey);

        }
    }
}
